import Instance from "@/utils/http.ts"


const USER_BASE=`/sys-user/`;

export function getAllUserAPI(current:number,pageSize:number){
    return Instance({
        url: USER_BASE+`all`,
        method:"GET",
        params:{
            current:current,
            pageSize:pageSize
        }
    })
}

export function deleteOneAPI(id:number){
    return Instance({
        url: USER_BASE+`deleteOne`,
        method:"DELETE",
        params:{
            id:id
        }
    })
}
export function saveOneUserAPI(formData:FormData){
    return Instance({
        url:USER_BASE+`saveOneUser`,
        method:"POST",
        data:formData,
        headers:{
            'content-type':'multipart/form-data'
        }
    })
}

export function modifyUserAPI(formData:FormData){
    return Instance({
        url:USER_BASE+`modifyUser`,
        method:"PUT",
        data:formData,
        headers:{
            'content-type':'multipart/form-data'
        }
    })
}


// 获取当前登录用户的详细信息
export function getUserDetailAPI(){
    return Instance({
        url:USER_BASE+`getUserDetail`,
        method:"GET",
    })
}
//根据id获取用户详细信息
export function getUserDetailByIdAPI(id:number){
    return Instance({
        url:USER_BASE+`${id}`,
        method:"GET",
    })
}

